	<?php
	$roomID = $_GET["roomID"];
	
	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("ciu196", $con);
	
	$sql = "
	SELECT studentID, studentName, message 
	FROM  HelpQueue
	WHERE roomID =  '$roomID'
	ORDER BY TIME DESC";
	$res = mysql_query($sql,$con);	

	$helpQueue = "";
	while($row = mysql_fetch_array($res)) {
		$helpQueue .= $row[0] . "\n";
		$helpQueue .= $row[1] . "\n";
		$helpQueue .= $row[2] . "\n";
	}
	
	echo $helpQueue;
	
	mysql_close();
?>